using System.Collections.Generic;
using Headsight.BPMN2WF.BPMN.Schemas;
using Headsight.BPMN2WF.Testing.TestObjCtors;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Headsight.BPMN2WF.BPMN.Model
{
    [TestClass]
    public class BPMNFlowNodesBlockFactoryNoGoodNameYetTest
    {
        private BPMNFlowNodesBlockFactory _sut;

        private IList<BPMNFlowNode> _bpmnFlowNodes;
        private IList<BPMNSequenceFlow> _bpmnSeqFlows;
        private List<BPMNArgument> _bpmnProcArgs;
        private BPMNProcessFactoryParams _bpmnMFacParams;

        [TestInitialize]    
        public void SetUp()
        {
            _bpmnFlowNodes = new List<BPMNFlowNode>();
            _bpmnSeqFlows = new List<BPMNSequenceFlow>();
            _bpmnProcArgs = new List<BPMNArgument>();
            
            _bpmnMFacParams = new BPMNModelFactoryParamsCtor()
                .WithBPMNProcessArguments(_bpmnProcArgs)
                .WithBPMNFlowNodes(_bpmnFlowNodes)
                .WithBPMNSequenceFlows(_bpmnSeqFlows)
                .Create();

            _sut = new BPMNFlowNodesBlockFactory(_bpmnMFacParams);
        }

        [TestMethod]
        public void Create()
        {
            var tProcess = new tProcessCtor()
                .WithStartEvent("start").Create();
            var tDefinitions = new tDefinitionsCtor()
                .With(tProcess).Create();

            var startEvent = new tStartEvent();
            _bpmnFlowNodes.Add(new BPMNFlowNodeCtor().WithId("start").WithTFlowElement(startEvent).Create());

            var actual = _sut.CreateBPMNFlowNodesBlock(tDefinitions);

            Assert.AreSame(startEvent, actual.TElement);
            Assert.AreSame(_bpmnProcArgs, actual.Arguments);
            //Assert.AreEqual(_bpmnFlowNodes, actual.BPMNProcess.BPMNFlowNodes);
            //Assert.AreSame(_bpmnSeqFlows, actual.BPMNSequenceFlows);
        }
    }
}